package util {

	import globals.Global;
	
	import ui.component.Button;
	import ui.component.ImageButton;
	import ui.component.TextButton;

	public class UIUtil {

		public function UIUtil() {
		}
		
		public static function getButton(keys:Array, handler:Function = null):Button {
			var button:Button = new Button(
				Global.assetsManager.getAssetsAsBitmapData(keys[0]),
				Global.assetsManager.getAssetsAsBitmapData(keys[1]),
				Global.assetsManager.getAssetsAsBitmapData(keys[2]),
				handler
			);
			return button;
		}
		
		public static function getImageButton(imageUrl:String, keys:Array, handler:Function = null):ImageButton {
			var button:ImageButton = new ImageButton(imageUrl,
				Global.assetsManager.getAssetsAsBitmapData(keys[0]),
				Global.assetsManager.getAssetsAsBitmapData(keys[1]),
				Global.assetsManager.getAssetsAsBitmapData(keys[2]),
				handler
			);
			return button;
		}
		
		public static function getTextButton(text:String, keys:Array, handler:Function = null):TextButton {
			var button:TextButton = new TextButton(text,
				Global.assetsManager.getAssetsAsBitmapData(keys[0]),
				Global.assetsManager.getAssetsAsBitmapData(keys[1]),
				Global.assetsManager.getAssetsAsBitmapData(keys[2]),
				handler
			);
			return button;
		}
		
		public static function getTextButton2(text:String, handler:Function = null):TextButton {
			var button:TextButton = new TextButton(text,
				null, null, null,
				handler
			);
			return button;
		}
	}
}